AutoKey User Interactive 

Declaration:

FUNCTION   AutoKey
VAR asciiCode:LONGINT ) :BOOLEAN ;

Description:

Function AutoKey returns TRUE if a non-modifier keyboard character has been continually depressed for longer than the system defined key repeat rate. If a keyboard character has been continually depressed, then ASCII code of the character is returned in parameter asciiCode.

Modifier keys are defined as the Caps Lock, Command, Control, Option, and Shift keys.

Parameters:

asciiCode The ASCII code of the key depressed.

Example:

WHILE NOT AutoKey(keyHit) DO
BEGIN
     SysBeep;
     SysBeep;
END;
Message('The key pressed was ',keyHit);



  BeginModeButtonsText User Interactive 

Declaration:

PROCEDURE   BeginModeButtonsText
;

Description:

Creates a mode bar buttons help text.

Example:

BeginModeButtonsText;
SetModeButtonText( 'Mode1', 1 );
SetModeButtonText( 'Mode2', 0 );
EndModeButtonsText;

See Also:

EndModeButtonsText   SetModeButtonText  



  CapsLock User Interactive 

Declaration:

FUNCTION   CapsLock
:BOOLEAN ;

Description:

CapsLock returns TRUE if the Caps Lock was depressed during the last user event. This function operates with the MouseDown, KeyDown, AutoKey, GetPt, GetPtL, GetLine, and GetRect calls.



  Command User Interactive 

Declaration:

FUNCTION   Command
:BOOLEAN ;

Description:

Command returns TRUE if the Command key (Mac) or Control key (Windows) was depressed during the last user event. This function operates with the MouseDown, KeyDown, AutoKey, GetPt, GetPtL, GetLine, and GetRect calls.



  EndModeButtonsText User Interactive 

Declaration:

PROCEDURE   EndModeButtonsText
;

Description:

Ends the creation of a mode bar buttons help text.

Example:

BeginModeButtonsText;
SetModeButtonText( 'Mode1', 1 );
SetModeButtonText( 'Mode2', 0 );
EndModeButtonsText;

See Also:

BeginModeButtonsText   SetModeButtonText  



  GetKeyDown User Interactive 

Declaration:

PROCEDURE   GetKeyDown
VAR asciiCode:LONGINT ) ;

Description:

Procedure GetKeyDown pauses execution of a VectorScript routine until a key is pressed by the user. When the key is pressed, the ASCII code of the key is returned.

Parameters:

asciiCode ASCII code of key pressed.



  GetLine User Interactive 

Declaration:

PROCEDURE   GetLine
( VAR  p1X :REAL;
  VAR  p1Y :REAL;
  VAR  p2X :REAL;
  VAR  p2Y :REAL
) ;

Description:

Procedure GetLine returns two user selected points, and draws a temporary "rubberband" line when prompting for the second point. This cannot be used if there is a function anywhere in the calling chain.

Parameters:

p1 Returns coordinates of first user click.
p2 Returns coordinates of second user click.



  GetLine3D User Interactive 

Declaration:

PROCEDURE   GetLine3D
( VAR  p1X :REAL;
  VAR  p1Y :REAL;
  VAR  p1Z :REAL;
  VAR  p2X :REAL;
  VAR  p2Y :REAL;
  VAR  p2Z :REAL;
    useWP :BOOLEAN
) ;

Description:

Procedure GetLine3D returns two user selected points, and draws a temporary "rubberband" 3D line when prompting for the second point. This cannot be used if there is a function anywhere in the calling chain.

Parameters:

p1 Returns coordinates of first user click.
p2 Returns coordinates of second user click.
useWP TRUE if the returned point have to be on the active Working Plane. Snapping to arbitrary 3D geometry will produce vertical projection result on the WP; FALSE if the point can be arbitrary 3D point (produced, for example, by snapping to a 3D geometry)

See Also:

GetPt   GetPtL   GetLine   GetRect   GetPt3D   GetPtL3D   GetLine3D   GetRect3D  



  GetMouse User Interactive 

Declaration:

PROCEDURE   GetMouse
( VAR  pX :REAL;
  VAR  pY :REAL
) ;

Description:

Procedure GetMouse tracks and returns the current location of the cursor within the active Vectorworks document, allowing the cursor coordinates to be returned dynamically while moving the cursor onscreen.

Parameters:

p Returns current mouse coordinates.

Example:

BEGIN
     WHILE NOT KeyDown(aCode) DO
     BEGIN
           GetMouse(CursX,CursY);
           Message('X : ',CursX,' Y : ',CursY);
     END;
END;
{displays the cursor coordinates as it is moved around onscreen}



  GetPt User Interactive 

Declaration:

PROCEDURE   GetPt
( VAR  pX :REAL;
  VAR  pY :REAL
) ;

Description:

Procedure GetPt switches the cursor to selection mode and allows the user to select a point in a Vectorworks document. This cannot be used if there is a function anywhere in the calling chain.

Parameters:

p Returns coordinates of mouse click.

Example:

PROCEDURE Example;
VAR
	pt :POINT;
BEGIN
	GetPt(pt.x, pt.y);
	Message(pt);
END;
RUN(Example);



  GetPt3D User Interactive 

Declaration:

PROCEDURE   GetPt3D
( VAR  pX :REAL;
  VAR  pY :REAL;
  VAR  pZ :REAL;
    useWPOnly :BOOLEAN
) ;

Description:

Procedure GetPt3D switches the cursor to 3D selection mode and allows the user to select a point in a VectorWorks document. This cannot be used if there is a function anywhere in the calling chain.

Parameters:

p Returns coordinates of mouse click.
useWPOnly TRUE if the returned point have to be on the active Working Plane. Snapping to arbitrary 3D geometry will produce vertical projection result on the WP; FALSE if the point can be arbitrary 3D point (produced, for example, by snapping to a 3D geometry)

See Also:

GetPt   GetPtL   GetLine   GetRect   GetPt3D   GetPtL3D   GetLine3D   GetRect3D  



  GetPtL User Interactive 

Declaration:

PROCEDURE   GetPtL
(   p1X :REAL;
    p1Y :REAL;
  VAR  p2X :REAL;
  VAR  p2Y :REAL
) ;

Description:

Procedure GetPtL creates a temporary "rubberband" line from a specified point to the user selected end point. This cannot be used if there is a function anywhere in the calling chain.

Parameters:

p1 Coordinates of line start point.
p2 Returns coordinates of mouse click.

Example:

PROCEDURE Example;
VAR
	pt1, pt2 :VECTOR;
BEGIN
	GetPt(pt1.x, pt1.y);
	GetPtL(pt1.x, pt1.y, pt2.x, pt2.y);
	MoveTo(pt1.x, pt1.y);
	LineTo(pt2.x, pt2.y);
END;
RUN(Example);



  GetPtL3D User Interactive 

Declaration:

PROCEDURE   GetPtL3D
(   p1X :REAL;
    p1Y :REAL;
    p1Z :REAL;
  VAR  p2X :REAL;
  VAR  p2Y :REAL;
  VAR  p2Z :REAL;
    useWPOnly :BOOLEAN
) ;

Description:

Procedure GetPtL3D creates a temporary "rubberband" 3D line from a specified point to the user selected end point. This cannot be used if there is a function anywhere in the calling chain.

Parameters:

p1 Coordinates of line start point.
p2 Returns coordinates of mouse click.
useWPOnly TRUE if the returned point have to be on the active Working Plane. Snapping to arbitrary 3D geometry will produce vertical projection result on the WP; FALSE if the point can be arbitrary 3D point (produced, for example, by snapping to a 3D geometry)

See Also:

GetPt   GetPtL   GetLine   GetRect   GetPt3D   GetPtL3D   GetLine3D   GetRect3D  



  GetRect User Interactive 

Declaration:

PROCEDURE   GetRect
( VAR  p1X :REAL;
  VAR  p1Y :REAL;
  VAR  p2X :REAL;
  VAR  p2Y :REAL
) ;

Description:

Procedure GetRect draws a temporary "rubberband" rectangle onscreen, similar to a selection marquee. The user defines the rectangle by selecting two points which define the top left and bottom right of the rectangle. This cannot be used if there is a function anywhere in the calling chain.

Parameters:

p1 Returns coordinates of first user click.
p2 Returns coordinates of second user click.



  GetRect3D User Interactive 

Declaration:

PROCEDURE   GetRect3D
( VAR  p1X :REAL;
  VAR  p1Y :REAL;
  VAR  p1Z :REAL;
  VAR  p2X :REAL;
  VAR  p2Y :REAL;
  VAR  p2Z :REAL;
    useWP :BOOLEAN
) ;

Description:

Procedure GetRect3D draws a temporary "rubberband" 3D rectangle on the working plane. The user defines the rectangle by selecting two points which define the top left and bottom right of the rectangle. This cannot be used if there is a function anywhere in the calling chain.

Parameters:

p1 Returns coordinates of first user click.
p2 Returns coordinates of second user click.
useWP TRUE if the returned point have to be on the active Working Plane. Snapping to arbitrary 3D geometry will produce vertical projection result on the WP; FALSE if the point can be arbitrary 3D point (produced, for example, by snapping to a 3D geometry)

See Also:

GetPt   GetPtL   GetLine   GetRect   GetPt3D   GetPtL3D   GetLine3D   GetRect3D  



  KeyDown User Interactive 

Declaration:

FUNCTION   KeyDown
VAR asciiCode:LONGINT ) :BOOLEAN ;

Description:

Function KeyDown returns TRUE if a non-modifier keyboard character has been depressed. When TRUE is returned, the ASCII code of the character is returned.

Modifier keys are the Caps Lock, Command, Control, Option, and Shift keys.

Parameters:

asciiCode ASCII code of key pressed.

Example:

WHILE NOT KeyDown(keyHit) DO
BEGIN
     SysBeep;
     SysBeep;
END;
Message('The key pressed was ',keyHit);
{an annoying example of one use of the KeyDown function}



  MouseDown User Interactive 

Declaration:

FUNCTION   MouseDown
( VAR  pX :REAL;
  VAR  pY :REAL
) :BOOLEAN ;

Description:

Function MouseDown returns TRUE if a mouse down event has occurred within the active document window.

Parameters:

p Returns coordinates of mouse click.

Example:

REPEAT
UNTIL MouseDown(x1,y1);
REPEAT
UNTIL MouseDown(x2,y2);
MoveTo(x1,y1);
LineTo(x2,y2);



  Option User Interactive 

Declaration:

FUNCTION   Option
:BOOLEAN ;

Description:

Option return TRUE if the Option key (Mac) or Alt key (Windows) was depressed during the last user event. This function operates with the MouseDown, KeyDown, AutoKey, GetPt, GetPtL, GetLine, and GetRect calls.

See Also:

MouseDown   KeyDown   AutoKey  



  RunTempTool User Interactive 

Declaration:

PROCEDURE   RunTempTool
(   toolCallback :PROCEDURE;
    initialScroll :BOOLEAN
) ;

Description:

Runs a temp tool. The call waits until the tool has finished. The callback function is notified for the tool events.

Parameters:

toolCallback Procedure that will be called with the tool events.
FUNCTION ToolCallback(action, msg1, msg2 : INTEGER) : INTEGER;
initialScroll For experts. Pass FALSE if you want a simple temp tool. Setting it to TRUE will add one extra point (0,0) before the tool runs. This will make the tool scroll before the first click. This means that your tool handler must recognize and skip that extra first.

Example:

PROCEDURE Test;
VAR
    pt1, pt2 : POINT;

    FUNCTION TempToolCallback(action, msg1, msg2 : LONGINT) : LONGINT;
    VAR pt : POINT;
    BEGIN
         TempToolCallback := 0;
         CASE action OF
             3: BEGIN {kOnToolDoSetupEventID}
		             vstSetHelpString ( 'Just click once.' );
             END;

             103 : BEGIN {kToolDrawEventID}
                 vstGetCurrPt2D( pt.x, pt.y );
                 vstDrawCoordLine( pt.x, pt.y, pt1.x, pt1.y );
                 vstDrawCoordLine( pt.x, pt.y, pt2.x, pt2.y );
             END;
         END;
    END;

BEGIN
    pt1.x := 0; pt1.y := 0;
    pt2.x := 100mm; pt2.y := 100mm;
    RunTempTool( TempToolCallback, FALSE );
END;
RUN( Test );



  SetCursor User Interactive 

Declaration:

PROCEDURE   SetCursor
( cursor:INTEGER ) ;

Description:

Procedure SetCursor changes the appearance of the screen cursor.

Table - Cursor Styles

Cursor Style Style Flag
Large Cross LgCrossC
Small Cross SmCrossC
Watch WatchC
Text Bar TextBarC
Arrow ArrowC
Hand HandC

Parameters:

cursor Cursor style setting.

Example:

SetCursor(LgCrossC);



  SetModeButtonText User Interactive 

Declaration:

PROCEDURE   SetModeButtonText
(   modeName :STRING;
    modeType :INTEGER
) ;

Description:

Sets a mode bar button help text.

Parameters:

modeName The name of the mode.
modeType The type of the mode. Types: RadioMode = 0, ButtonMode = 1, PrefButtonMode = 2, CheckMode = 3, EditTextMode = 4, PullDownMode = 5

Example:

BeginModeButtonsText;
SetModeButtonText( 'Mode1', 1 );
SetModeButtonText( 'Mode2', 0 );
EndModeButtonsText;

See Also:

BeginModeButtonsText   EndModeButtonsText  



  SetTempToolHelpStr User Interactive 

Declaration:

PROCEDURE   SetTempToolHelpStr
( helpString:STRING ) ;

Description:

Sets a text to be used as help string for temp tool calls: RunTempTool, TrackObject, GetPt, GetPtL, GetPt3D, and GetPtL3D.

This function should be called prior to calling the tool.

The help string will be used for subsequent temp tool runs until changed.

Parameters:

helpString The help string for the next temp tool.

Example:

PROCEDURE Test;
VAR h : HANDLE;
  
  FUNCTION CheckObjCallback(h : HANDLE) : BOOLEAN;
  BEGIN
     {any object is ok}
     CheckObjCallback := true;
  END;

BEGIN
SetTempToolHelpStr( 'Select any object' );
TrackObject( CheckObjCallback, h );
SetSelect( h );
END;
RUN( Test );



  SetToolHelpMessage User Interactive 

Declaration:

PROCEDURE   SetToolHelpMessage
(   modeText :STRING;
    descriptionText :STRING
) ;

Description:

Sets the Tool Bar Help Text by new standard - Tool Name[: Tool Mode][. Brief usage advice.].

Parameters:

modeText The text that will be showed like as a name of the mode.
descriptionText The text that will be showed like as an advice text.



  Shift User Interactive 

Declaration:

FUNCTION   Shift
:BOOLEAN ;

Description:

Shift returns TRUE if the Shift key was depressed during the last user event. This function operates with the MouseDown, KeyDown, AutoKey, GetPt, GetPtL, GetLine, and GetRect calls.



  TrackObject User Interactive 

Declaration:

PROCEDURE   TrackObject
(   callback :PROCEDURE;
  VAR  outObj :HANDLE;
  VAR  pX :REAL;
  VAR  pY :REAL;
  VAR  pZ :REAL
) ;

Description:

Interactively, including highlighting, allows the user to select one object meeting the specified criteria.

The callback function (any of these depending on what info is needed):

FUNCTION Callback(h : HANDLE): BOOLEAN;
FUNCTION CheckObjCallback(h : HANDLE; px, py : REAL) : BOOLEAN;
FUNCTION CheckObjCallback(h : HANDLE; px, py, pz : REAL) : BOOLEAN;

is used to let the user filter the object that can be returned from the function.

The parameteri px,py,pz pass into the function information about current cursor position in document units.

This callback function is called when tracking over an object; also when click happens over an object.

The callback function return true if the passed handle can be returned.

Parameters:

callback The callback that will be called to check if an object meets the requrements to be tracked. See remarks.
outObj Returns handle of the object for which the callback returned TRUE.
p Returns coordinates of mouse click.

Example:

PROCEDURE Test;
VAR
  h : HANDLE;
  x, y, z : REAL;
  
  FUNCTION CheckObjCallback(h : HANDLE) : BOOLEAN;
  {or FUNCTION CheckObjCallback(h : HANDLE; px, py : REAL) : BOOLEAN;}
  {or FUNCTION CheckObjCallback(h : HANDLE; px, py, pz : REAL) : BOOLEAN;}
  BEGIN
     {any object is ok}
     CheckObjCallback := true;
  END;

BEGIN
	TrackObject( CheckObjCallback, h, x, y, z );
	SetSelect( h );
END;
RUN( Test );